package leetcode;

/**
 * 描述:
 *
 * @author Madison You
 * @created 23:29
 */
public class Easy_9_IsPalindrome {
    public static void main(String[] args) {
        new Easy_9_IsPalindrome().isPalindrome(121);
    }

    public boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        int tmp = x;
        int n = 0;
        while (x > 0) {
            n = n * 10 + x % 10;
            x = x / 10;
        }
        return tmp == n;
    }
}
